#include"BinaryTree.h"

BTNode* BuyBTNode(int val)
{
	BTNode* newnode = (BTNode*)malloc(sizeof(BTNode));
	if (newnode == NULL)
	{
		perror("malloc fail");
		return NULL;
	}
	newnode->_data = val;
	newnode->_left = NULL;
	newnode->_right = NULL;

	return newnode;
}

//             1
//      2             3
//   4     5        6   7
//            8
BTNode* CreatBinaryTree()
{
	BTNode* n1 = BuyBTNode(1);
	BTNode* n2 = BuyBTNode(2);
	BTNode* n3 = BuyBTNode(3);
	BTNode* n4 = BuyBTNode(4);
	BTNode* n5 = BuyBTNode(5);
	BTNode* n6 = BuyBTNode(6);
	BTNode* n7 = BuyBTNode(7);
	BTNode* n8 = BuyBTNode(8);

	n1->_left = n2;
	n1->_right = n3;

	n2->_left = n4;
	n2->_right = n5;

	n3->_left = n6;
	n3->_right = n7;

	n5->_right = n8;
}

int main()
{

	return 0;
}